package net.example.lesson5.copyfile;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

public class NioFilesCopy {
    public static void main(String[] args) {
        try {
            long t1 = System.currentTimeMillis();
            Files.copy(Paths.get(System.getProperty("user.dir")+"\\file\\cargo.war"),
                    Paths.get(System.getProperty("user.dir")+"\\file\\cargo4.war"));
            System.out.println("耗时："+(System.currentTimeMillis()-t1));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
